In testing and performing diagnostics in a computer system, processes executing on the computer system may be logged to allow for debugging. A process is typically logged by providing information generated by the process to a location where it can be examined. The information provided at selected points in the execution of the process may be compared to expected information to detect discrepancies between the expected information and the logged information.
Computer systems may allow multiple execution contexts (e.g., threads, fibers, or child processes) of a process to be executed concurrently. With concurrent execution, various techniques may be used to make the logging concurrency safe to ensure that the desired information is produced when the process is logged. These techniques, however, may affect the throughput of the process in the computer system and may significantly alter the execution paths of the process in the computer system when the process is executed. The techniques may also hide races between different execution contexts of the process due to memory reordering.